const { UserModel } = require('../utils/db2')

const save = (data) => {
  let userModel = new UserModel(data)
  return userModel.save()
}

const patch = (data) => {
  return UserModel.findByIdAndUpdate(data.id, data)
}

const remove = (data) => {
  return UserModel.findByIdAndRemove(data.id)
}

module.exports = {
  save,
  patch,
  remove
}